class Egg{
    constructor(color){
        this.color = color
    }
    /**
     * 随机显示一个蛋
     * @param {ground} ground 场地实例 
     * @param {snakePos} snakePos 蛇的位置信息
     */
    create(ground,snakePos){
        // console.log(snakePos);
        const eggCol = ~~(Math.random()*ground.col);
        const eggRow = ~~(Math.random()*ground.row);
        this.eggCol = eggCol;
        this.eggRow = eggRow;
        ground.ground['children'][eggCol]['children'][eggRow].style.backgroundColor = this.color;
    }
}

export default Egg;